import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './uploadphoto.css'
import { AtSteps,AtImagePicker,AtButton } from 'taro-ui'
import {$redirectTo} from '../../../global'
export default class UploadPhoto extends Component {

  config = {
    navigationBarTitleText: '快速问诊'
  }
  constructor () {
    super(...arguments)
    this.state = {
      current: 7,
      files: []
    }
  }
  onChange (current) {
    this.setState({
      current
    })
  }
  onChange (files) {
    this.setState({
      files
    })
  }
  onFail (mes) {
    console.log(mes)
  }
  onImageClick (index, file) {
    console.log(index, file)
  }
  weti=()=>{
    app.redirectTo("../dialogend/dialogend")
  }
  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    const items = [
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' },
        { 'title': '' }
      ];
    return (
      <View className='upload-photo'>
         <AtSteps
         className='steps'
        items={items}
        current={this.state.current}
        onChange={this.onChange.bind(this)}
        length='3'
      />   
      <View className='title'>上传资料</View>
      <View className='tips'>上传检查资料、病历、处方、药品包装等照片</View>
      <AtImagePicker
        multiple
        files={this.state.files}
        onChange={this.onChange.bind(this)}
        onFail={this.onFail.bind(this)}
        onImageClick={this.onImageClick.bind(this)}
        className='area'
        />
        <View className='btn-box'><AtButton className='next-btn' onClick={this.weti} full>下一步</AtButton></View>
      </View>
    )
  }
}

